feat: Restart deployments when there are changes to config maps#346
feat: Restart deployments when there are changes to config maps#346ravisoundar wants to merge 1 commit into
Conversation
Signed-off-by: Ravi Shankar <ravish@nvidia.com>
Greptile SummaryThis PR adds a
Confidence Score: 5/5Safe to merge; the change is additive and follows the standard Helm rolling-restart pattern without touching any runtime logic. Both deployment templates correctly hash their own configmap.yml via sha256sum, ensuring pods restart whenever managed ConfigMap content changes. The restructuring of the annotations block is valid — the checksum annotation is unconditional while user-supplied podAnnotations remain optional. Golden test files are updated and the differing checksums across test scenarios confirm the hash reflects actual value differences. The GCP workload identity path in charts/topograph/templates/deployment.yaml is the only area where coverage could be extended if full ConfigMap tracking is desired. Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User/CI
participant Helm
participant ConfigMap
participant Deployment
participant K8s as Kubernetes
User->>Helm: helm upgrade (values change)
Helm->>ConfigMap: Render + apply updated ConfigMap
Helm->>Deployment: "Render deployment with checksum/config = sha256(configmap.yml)"
Note over Deployment: Annotation value changed -> pod template hash differs
Deployment->>K8s: Apply updated pod template
K8s->>K8s: Rolling restart triggered
K8s-->>User: Pods restarted with new config
Reviews (1): Last reviewed commit: "feat: Restart deployments when there are..." | Re-trigger Greptile |
| metadata: | ||
| {{- with .Values.podAnnotations }} | ||
| annotations: | ||
| checksum/config: {{ include (print $.Template.BasePath "/configmap.yml") . | sha256sum }} |
There was a problem hiding this comment.
External ConfigMaps not tracked by checksum
The checksum/config annotation hashes only the internally-managed configmap.yml. The topograph deployment also mounts a second ConfigMap — the GCP workload identity federation credentialsConfigmap ($providerParams.workloadIdentityFederation.credentialsConfigmap) — which is managed outside this chart. Changes to that external ConfigMap will not change the annotation and therefore will not trigger a rolling restart. If that config can be updated independently (e.g. token audience or service account rotation), operators would need to manually trigger a restart. This is a known limitation of the single-file checksum approach and may be acceptable, but it's worth documenting.
Description
Helm update to restart topograph deployment when the config map is changed.
Checklist
git commit -s).